package com.yshkj.payment.service.impl;

import com.yshkj.payment.repository.UserAccountRepository;
import com.yshkj.payment.service.UserAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by 唐旭 on 2016/9/7.
 */
@Service
@Transactional
public class UserAccountServiceImpl implements UserAccountService {

    @Autowired
    private UserAccountRepository userAccountRepository;

    @Override
    @Transactional(readOnly = true)
    @Cacheable(value = "UserAccount", key = "#username")
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        //方法已经废弃,功能转移至AccountServiceImpl.loadUserByUsername(username);
        throw new UnsupportedOperationException("此方法已经废弃");
    }
}
